package com.wandian.texas.entity;

import java.util.Date;

/**
 * 用户基本信息
 * 
 * @author long
 * @Create 2012-10-6 下午3:02:45
 * @QQ 108232706
 * @version 1.0
 * @description UserInfoEntity
 */
public class UserInfoEntity extends DataObject {

	/**
	 * 账号扩展表的id
	 */
	public int userId;
	/**
	 * 账号总表的id
	 */
	public int AccountId;
	/**
	 * 账号总表的账号[account]
	 */
	//	public int Account;
	/**
	 * 0任意,为玩家,125为robot
	 */
	public byte userType;
	/**
	 * 账号总表的账号[account]
	 */
	public String userName;
	/**
	 * 大厅给客户端生成的，同时在OnlyLogin会产生flag=1的记录，有效期10分钟
	 */
	public int key;
	public String password;
	public String passwordSalt;
	public String nickName;
	private byte[] headImage;
	public String realName;
	public String icon;
	public int personId;
	public int vip;
	public String email;
	public String mobile;
	public byte sex;
	public byte status;
	//	public int score;
	/**
	 * 玩家游戏内的钱，已经做了转换
	 */
	public float money;
	public float maxmoney;
	public String maxHandCards;
	public int maxWin;
	//	public int gold;
	public int rank;
	public int winrank;
	public Date createDate;
	public boolean checkLogin;

	public int serverId;
	public int gameId;
	public int roomId;
	public int seatId;
	public int gameOverSeatId;
	public int stateSocket;
	// public DataPacket dataPacket;
	/**
	 * 边池索引,以后分钱的时候要做判断，是否在该池下过钱
	 */
	public int curBonusIndex = 0;
	/**
	 * 操作类型
	 */
	public int lastAction;
	/**
	 * 本次下注
	 */
	//	private float _callChip;

	// public int callChip() {
	// return _callChip;
	// }
	//
	// /**
	// * 玩家每次操作时候，下注的金额
	// *
	// * @param callChip
	// */
	// public void callChip(int callChip) {
	// this._callChip += callChip;
	// this.seatChip += callChip;
	// this.totalChip += callChip;
	// this.stake -= callChip;
	// System.out.println("玩家下注" + callChip + " 剩余stake:" + stake);
	// // return this.callChip;
	// }
	// public void clear(){
	// this._callChip=0;
	// this.seatChip=0;
	// this.step=0;
	// }

	/**
	 * 本次为止，坐位上总chip
	 */
	public int seatChip;
	/**
	 * 本次为止,4轮(这一局的)总下注
	 */
	public int totalChip;
	/**
	 * 坐下时候买入的筹码
	 */
	public float stake;
	/**
	 * 每一局游戏总下注，在玩家站起或者游戏结束，清0 如果是服务器在玩家游戏里宕机，gamebet>0，需要清除，并且还原 +一个负的bet记录
	 */
	public float gameBet;
	/**
	 * 玩家状态,0正常,-1 起立，-2离开房间，-3注销 ，-4掉线
	 */
	public int state;
	public int isWin;

	public int sumGame;
	public int winGame;
	public int giftPcate;
	public int giftPframe;
	public int banSpeak;
	public int yellowvip;
	public int isyearvip;

	public boolean isNew;
	public boolean isKick;
	public String card1 = "--";
	public String card2 = "--";

	// public String[] maxHandcard = new String[5];

	// public void read(short cmdid, DataPacket dataPacket) {
	// switch (cmdid) {
	// case Protocol.UserLoginCmd:
	// this.userName = dataPacket.readString();
	// break;
	// case Protocol.CHATROOM_SEND_MESSAGE:
	// this.userId = dataPacket.readInt();
	// break;
	// default:
	// break;
	// }
	// }
	//
	// public void write(short cmdid, DataPacket dataPacket) {
	// switch (cmdid) {
	// case Protocol.UserLoginCmd:
	// dataPacket.writeString(this.userName);
	// break;
	// case Protocol.CHATROOM_SEND_MESSAGE:
	// dataPacket.writeInt(this.userId);
	// break;
	// default:
	// break;
	// }
	// }

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public byte getSex() {
		return sex;
	}

	public void setSex(byte sex) {
		this.sex = sex;
	}

	public byte getStatus() {
		return status;
	}

	public void setStatus(byte status) {
		this.status = status;
	}

	//	public int getScore() {
	//		return score;
	//	}
	//
	//	public void setScore(int score) {
	//		this.score = score;
	//	}

	public float getMoney() {
		return money;
	}

	public void setMoney(int money) {
		this.money = money;
	}

	//	public int getGold() {
	//		return gold;
	//	}
	//
	//	public void setGold(int gold) {
	//		this.gold = gold;
	//	}

	public boolean isCheckLogin() {
		return checkLogin;
	}

	public void setCheckLogin(boolean checkLogin) {
		this.checkLogin = checkLogin;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPasswordSalt() {
		return passwordSalt;
	}

	public void setPasswordSalt(String passwordSalt) {
		this.passwordSalt = passwordSalt;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	@Override
	public String toString() {
		return "userid:" + userId + " AccountId:" + AccountId + " userName:" + userName + " nickName:" + nickName + " roomId:" + roomId + " seatId:" + seatId + " stake:" + stake + " money:" + money + " lastAction:" + lastAction;
		//		return String.format("userid:%s accountid:%s username:%s nickname:%s roomid:%s seatId:%s ,stake:%s money:%s,,lastaction:%s ", userId, AccountId, userName, nickName, roomId, seatId, stake, money, lastAction);

	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public int getRank() {
		return rank;
	}

	public void setRank(int rank) {
		this.rank = rank;
	}

	public byte[] getHeadImage() {
		return headImage;
	}

	public void setHeadImage(byte[] headImage) {
		this.headImage = headImage;
	}
}
